import http from './httpRequest.js'

// 注册发送验证码
export function resetPassword(data){
    return http({
		url: `/user/reset/password`,
		method: 'post',
        data
	})
}


/**
 * 国家
 * @param {Object} data
 */
export function countryList(data) {
	return http({
		url: `/dataregion/country/list`,
		method: 'get',
        data
	})
}

/**
 * 省
 * @param {Object} data
 */
export function provinceList(parentId) {
	return http({
		url: `dataregion/province/list/${parentId}`,
		method: 'get',
	})
}

/**
 * 市
 * @param {Object} data
 */
export function cityList(parentId) {
	return http({
		url: `/dataregion/city/list/${parentId}`,
		method: 'get',
	})
}



/**
 * 设置备注
 * @param {Object} data
 */
export function friendUpdate(data) {
	return http({
		url: `/im/friend/update`,
		method: 'put',
        data
	})
}


/**
 * 注销账户
 * @param object data
 * 
 */
export function userOut(data) {
	return http({
		url: `/user/logoff`,
		method: 'post',
        data
	})
}


// code: 1， name: "头像"
// code: 2, name: "密码"
// code: 3, name: "昵称"
// code: 4, name: "手机"
// code: 5, name: "邮箱"
// code: 6 name: "自动删除消息"
// code: 7, name: "国家"
// code: 8 name: "签名"
// code: 9 name: "性别"
// code: 10 name: "地区"
// code: 12 name: "自动好友同意"
export function updateField(data){
	return http({
		url: `/user/updateField`,
		method: 'post',
        data
	})
}